package com.bytebuddytest.quickstart;

/**
 * @author yutianhong
 * @version 1.0
 * @since 2023/08/14 10:38:40
 */
public class GreetingInterceptor {
    public Object greet(Object argument) {
        return "Hello from " + argument;
    }

    /**
     * 会拦截Function::apply，与`GreetingInterceptor::greet`竞争。
     * 会导致byte-buddy报错
     */
//    public String greet2(Object argument) {
//        return "Hello from " + argument;
//    }

    /**
     * 不会拦截Function::apply，因为类型不匹配
     */
    public Object greetFromTwo(Object argument, Object argument2) {
        return "Hello from " + argument + " " + argument2;
    }
}
